
import { get, post, del, uploadImage } from '../utils/request'
module.exports = {
  getTimelines: function (query) {
    return get('/timelines/', {}, query)
  },
  createTimeline: function (param) {
    // 创建时间线
    return post('/timelines/', param)
  },
  deleteTimeline: function (id) {
    // 删除时间线
    return del(`/timelines/${id}/`)
  },
  // 生活记录

  getLifeRecords: function (query) {
    return get('/timelines/liferecords/', {}, query)
  },
  createLifeRecord: function (param) {
    return post('/timelines/liferecords/', param)
  },
  deleteLifeRecord: function (id) {
    return del(`/timelines/liferecords/${id}/`)
  },
  // 上传图片
  uploadLifeRecordImage: function (imgList) {
    return uploadImage('/timelines/liferecords/upload/', imgList)
  },
  // 删除图片
  delImage: function (id) {
    return del('/timelines/liferecords/image/del/', { 'id': id })
  }
}